package com.bwie.controller;

import com.bwie.service.TbOrderService;
import com.bwie.utils.R;
import com.bwie.vo.TbOrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tbOrder")
@Api(tags = "订单微服务")
public class TbOrderController {


    @Autowired
    TbOrderService tbOrderService;


    /**
     * @description: 订单生成
     * @author: xushuaihang
     * @Date: 2024/6/17 13:30
     * @param:
     * @param tbOrderVo
     * @return: com.bwie.utils.R
    **/
    @ApiOperation("订单生成")
    @PostMapping("/addOrder")
    public R  addOrder(@RequestBody TbOrderVo tbOrderVo){

        return tbOrderService.addOrder(tbOrderVo);
    }

    /**
     * @description: 订单列表
     * @author: xushuaihang
     * @Date: 2024/6/17 13:30
     * @param:
     * @param
     * @return: com.bwie.utils.R
    **/
    @ApiOperation("订单列表")
    @PostMapping("/orderList")
    public R  orderList(){

        return tbOrderService.orderList();
    }
}
